<template>
  <!-- 该页面是表格的操作列三个图标 -->
  <div>
    <el-tooltip
      v-for="action in actions"
      :key="action.name"
      class="item"
      :effect="action.effect"
      :content="action.label"
      placement="top"
    >
      <i :class="`${action.iconClass} partition`" @click="handleClick(action.name)"></i>
    </el-tooltip>
  </div>
</template>

<script>
export default {
  name: 'ActionButtons',
  props: {
    actions: {
      type: Array,
      required: true,
    },
     item: {
      type: Object,
      required: true,
    },
  },
  methods: {
    handleClick(actionName) {
      this.$emit('action-click', actionName,this.item);
    },
  },
};
</script>

<style lang="scss" scoped>
.partition {
  margin: 5px;
}
</style>
